#!/bin/bash
# Java 8 required
sh_folder=$(cd "$(dirname $0)"; pwd -P)
if [ -d "$sh_folder/../myrpc-client-thrifty" ]
then
    pushd "$sh_folder/../myrpc-client-thrifty"
    OUT_FOLDER=src/thrifty/java
    [ -e "$OUT_FOLDER" ] && rm -fr "$OUT_FOLDER"
    mvn com.gitee.l0km:thrifty-compiler-maven-plugin:stub || exit
    popd
fi